package com.insta.library.DAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class InitTable implements DataAccessConstants{

	public static void main(String[] args) {
		try{
			Class.forName(JDBC_DRIVER).newInstance();
			Connection connexion = DriverManager.getConnection(URL_DB, "sa",  "");
			System.out.println("-- Connexion Opened...");
			
			Statement statement = connexion.createStatement();
			ResultSet resultat= statement.executeQuery("SELECT * FROM PERSON");
			while(resultat.next()){
				System.out.println("|__ " + resultat.getString("name"));
			}
			
			statement.close();
			connexion.close();
			System.out.println("--Connection Finished...");
		}
		catch(Exception e)
		{
			e.printStackTrace();		
		}
	}
}
